
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpGcmMsgcat.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpGcmMsgcatForm"
 */
public class CcpGcmMsgcatForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _msgcatGuid = null;
   private java.lang.String _msgcatNumber = null;
   private java.lang.String _msgcatLabel = null;
   private java.lang.String _name = null;
   private java.lang.String _catDesc = null;
   private java.lang.String _sysFlag = null;
   private java.lang.String _paretntcatGuid = null;
   private java.lang.String _genFlag = null;
   private java.lang.String _catOrder = null;
   private java.lang.String _reserved1 = null;
   private java.lang.String _reserved2 = null;
   private java.lang.String _reserved3 = null;

   /**
    * Standard constructor.
    */
   public CcpGcmMsgcatForm() {
   }

   /**
    * Returns the msgcatGuid
    *
    * @return the msgcatGuid
    */
   public java.lang.String getMsgcatGuid() {
      return _msgcatGuid;
   }

   /**
    * Sets the msgcatGuid
    *
    * @param msgcatGuid the new msgcatGuid value
    */
   public void setMsgcatGuid(java.lang.String msgcatGuid) {
      _msgcatGuid = msgcatGuid;
   }
   /**
    * Returns the msgcatNumber
    *
    * @return the msgcatNumber
    */
   public java.lang.String getMsgcatNumber() {
      return _msgcatNumber;
   }

   /**
    * Sets the msgcatNumber
    *
    * @param msgcatNumber the new msgcatNumber value
    */
   public void setMsgcatNumber(java.lang.String msgcatNumber) {
      _msgcatNumber = msgcatNumber;
   }
   /**
    * Returns the msgcatLabel
    *
    * @return the msgcatLabel
    */
   public java.lang.String getMsgcatLabel() {
      return _msgcatLabel;
   }

   /**
    * Sets the msgcatLabel
    *
    * @param msgcatLabel the new msgcatLabel value
    */
   public void setMsgcatLabel(java.lang.String msgcatLabel) {
      _msgcatLabel = msgcatLabel;
   }
   /**
    * Returns the name
    *
    * @return the name
    */
   public java.lang.String getName() {
      return _name;
   }

   /**
    * Sets the name
    *
    * @param name the new name value
    */
   public void setName(java.lang.String name) {
      _name = name;
   }
   /**
    * Returns the catDesc
    *
    * @return the catDesc
    */
   public java.lang.String getCatDesc() {
      return _catDesc;
   }

   /**
    * Sets the catDesc
    *
    * @param catDesc the new catDesc value
    */
   public void setCatDesc(java.lang.String catDesc) {
      _catDesc = catDesc;
   }
   /**
    * Returns the sysFlag
    *
    * @return the sysFlag
    */
   public java.lang.String getSysFlag() {
      return _sysFlag;
   }

   /**
    * Sets the sysFlag
    *
    * @param sysFlag the new sysFlag value
    */
   public void setSysFlag(java.lang.String sysFlag) {
      _sysFlag = sysFlag;
   }
   /**
    * Returns the paretntcatGuid
    *
    * @return the paretntcatGuid
    */
   public java.lang.String getParetntcatGuid() {
      return _paretntcatGuid;
   }

   /**
    * Sets the paretntcatGuid
    *
    * @param paretntcatGuid the new paretntcatGuid value
    */
   public void setParetntcatGuid(java.lang.String paretntcatGuid) {
      _paretntcatGuid = paretntcatGuid;
   }
   /**
    * Returns the genFlag
    *
    * @return the genFlag
    */
   public java.lang.String getGenFlag() {
      return _genFlag;
   }

   /**
    * Sets the genFlag
    *
    * @param genFlag the new genFlag value
    */
   public void setGenFlag(java.lang.String genFlag) {
      _genFlag = genFlag;
   }
   /**
    * Returns the catOrder
    *
    * @return the catOrder
    */
   public java.lang.String getCatOrder() {
      return _catOrder;
   }

   /**
    * Sets the catOrder
    *
    * @param catOrder the new catOrder value
    */
   public void setCatOrder(java.lang.String catOrder) {
      _catOrder = catOrder;
   }
   /**
    * Returns the reserved1
    *
    * @return the reserved1
    */
   public java.lang.String getReserved1() {
      return _reserved1;
   }

   /**
    * Sets the reserved1
    *
    * @param reserved1 the new reserved1 value
    */
   public void setReserved1(java.lang.String reserved1) {
      _reserved1 = reserved1;
   }
   /**
    * Returns the reserved2
    *
    * @return the reserved2
    */
   public java.lang.String getReserved2() {
      return _reserved2;
   }

   /**
    * Sets the reserved2
    *
    * @param reserved2 the new reserved2 value
    */
   public void setReserved2(java.lang.String reserved2) {
      _reserved2 = reserved2;
   }
   /**
    * Returns the reserved3
    *
    * @return the reserved3
    */
   public java.lang.String getReserved3() {
      return _reserved3;
   }

   /**
    * Sets the reserved3
    *
    * @param reserved3 the new reserved3 value
    */
   public void setReserved3(java.lang.String reserved3) {
      _reserved3 = reserved3;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getMsgcatGuid() == null) {
         errors.add("msgcatGuid", new ActionError("error.msgcatGuid.required"));
      }
      if(getMsgcatLabel() == null) {
         errors.add("msgcatLabel", new ActionError("error.msgcatLabel.required"));
      }
      if(getName() == null) {
         errors.add("name", new ActionError("error.name.required"));
      }
      if(getSysFlag() == null) {
         errors.add("sysFlag", new ActionError("error.sysFlag.required"));
      }
      if(getCatOrder() == null) {
         errors.add("catOrder", new ActionError("error.catOrder.required"));
      }
      // TODO test format/data
      return errors;
   }
}
